﻿<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<LINK rel="Bookmark" href="/favicon.ico" >
<LINK rel="Shortcut Icon" href="/favicon.ico" />
<link rel="stylesheet" type="text/css" href="/static/admin/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="/static/admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="/static/admin/css/iconfont.css" />
<link rel="stylesheet" type="text/css" href="/static/admin/css/style.css" />
<title>代金券列表</title>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 财务管理 <span class="c-gray en">&gt;</span> 代金券列表
    <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" id="refresh"><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
	<form action="<?php echo url('voucher/voucherList')?>" method="get">
		<div class="text-c">生效时间：
			<input type="text" name="startTime" value="<?php echo isset($display['startTime']) ? $display['startTime'] : ''?>" onfocus="WdatePicker()" id="datemin" class="input-text Wdate" style="width:120px;">
			至
			<input type="text" name="endTime" value="<?php echo isset($display['endTime']) ? $display['endTime'] : ''?>"   onfocus="WdatePicker()" id="datemax" class="input-text Wdate" style="width:120px;">
			<input type="text" name="searchName" value="<?php echo isset($display['searchName']) ? $display['searchName'] : ''?>" class="input-text" style="width:250px" placeholder="输入编号" id="" >
            <select class="select-box" style="width: 90px;padding: 5px 5px;" size="1" name="type_id">
				<option value="" selected>类型</option>
				<?php foreach($type as $v){ ?>
				<option value="<?php echo $v['id']?>" <?php if(isset($display['type_id']) && $display['type_id'] == $v['id']) echo 'selected';?>><?php echo $v['name']?></option>
				<?php } ?>
			</select>
			<select class="select-box" style="width: 70px;padding: 5px 5px;" size="1" name="status">
				<option value="" selected>状态</option>
				<option value="0" <?php if(isset($display['status']) && $display['status'] == 0) echo 'selected';?>>未发行</option>
				<option value="1" <?php if(isset($display['status']) && $display['status'] == 1) echo 'selected';?>>已发行</option>
				<option value="2" <?php if(isset($display['status']) && $display['status'] == 3) echo 'selected';?>>已失效</option>
			</select>
			<button type="submit" class="btn btn-success radius" style="margin-right: 300px;"><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
		</div>
	</form>
	<div class="cl pd-5 bg-1 bk-gray mt-20">
		<span class="l">
			<a href="javascript:;" onclick="show('添加代金券','<?php echo url('voucher/voucherAdd')?>','','')" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe600;</i> 添加代金券</a>
		</span>
	</div>
	<div class="mt-20">
	<table class="table table-border table-bordered table-hover table-bg table-sort mt-10">
		<thead>
			<tr class="text-c">
				<th width="40">ID</th>
				<th width="130">编号</th>
				<th width="250">代金券价值</th>
				<th width="50">类型</th>
				<th width="120">发行平台</th>
				<th width="50">发行张数</th>
				<th width="50">使用张数</th>
				<th width="120">生效时间</th>
				<th width="120">失效时间</th>
				<th width="60">状态</th>
				<th width="100">操作</th>
			</tr>
		</thead>
		<tbody>
		<?php foreach($list as $v):?>
			<tr class="text-c">
				<td><?php echo $v['id']?></td>
				<td><?php echo $v['voucher_no']?></td>
				<td><?php echo $v['type_id'] == 1 ? $v['price'] : $v['goods']?></td>
                <td><?php echo $v['name'];?></td>
                <td><?php echo empty($v['is_platform']) ? '商家券('.$v['business'].')' : '平台券'?></td>
                <td><?php echo $v['send_num'];?></td>
                <td><?php echo $v['use_num'];?></td>
                <td><?php echo empty($v['begin_time']) ? '-' : date('Y-m-d H:i:s',$v['begin_time'])?></td>
                <td><?php echo empty($v['end_time']) ? '-' : date('Y-m-d H:i:s',$v['end_time'])?></td>
                <td class="td-status"><span class="label <?php echo empty($v['status']) ? 'label-secondary' : ($v['status'] == 1 ? 'label-success' : 'label-defaunt');?> radius">
                    <?php echo empty($v['status']) ? '未发行' : ($v['status'] == 1 ? '已发行' : '已失效')?></span></td>
                <td class="td-manage">
					<?php if($v['status'] == 0){?>
                    <a class="ml-5" href="javascript:;" title="发行代金券"  onclick="show('发行代金券','<?php echo url('voucher/issue',array('id' => $v['id']))?>','','600','400')" style="text-decoration:none"><i class="Hui-iconfont">&#xe603;</i></a>
                    <a class="ml-5" href="javascript:;" title="编辑代金券"  onclick="show('编辑代金券','<?php echo url('voucher/voucherSave',array('id' => $v['id']))?>','','','')" style="text-decoration:none"><i class="Hui-iconfont">&#xe6df;</i></a>
                    <?php } else echo '-';?>
                </td>
			</tr>
		<?php endforeach;?>
        <?php if(empty($list)):?>
        <tr class="text-l"><td colspan="20">没有找到匹配的记录</td></tr>
        <?php endif;?>
		</tbody>
	</table>
	</div>
	<span class="r pages mt-10"><?php echo $page?></span>
</div>
<script type="text/javascript" src="/static/admin/js/jquery.min.js"></script>
<script type="text/javascript" src="/static/admin/js/layer.js"></script>
<script type="text/javascript" src="/static/admin/js/H-ui.min.js"></script>
<script type="text/javascript" src="/static/admin/js/H-ui.admin.js"></script>
<script type="text/javascript" src="/static/admin/lib/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">
/*详情*/
function show(title,url,id,w,h){
    layer_show(title,url,w,h);
}
</script>
</body>
</html>